package edu.sctu.zcy.month201505.day20150512;

/**
 * Created by user24 on 2015/5/12.
 */
public class Subs extends Parents {

    Nature[] nature;
    public Subs(Nature[] nature1){
        super("学生信息：");
        nature=nature1;

    }

    @Override
    public int print() {
        int k=0;
        for (int i = 0; i <nature.length ; i++) {
            if(nature[i].getAge()>18){
                k++;
                System.out.println("\n该学生已成年！\n"+nature[i].getName()+"\n"+nature[i].getAge()+"\n"
                        +nature[i].getHeight()+"\n"+nature[i].getWeight());

            }else{

                System.out.println("\n该学生是未成年人。\n"+nature[i].getName()+"\n"+nature[i].getAge()+"\n"
                        +nature[i].getHeight()+"\n"+nature[i].getWeight()+"\n");
            }
        }
        return k;

    }
}
